home *** CD-ROM | disk | FTP | other *** search
/ PC World Komputer 2010 April / PCWorld0410.iso / hity wydania / Ubuntu 9.10 PL / karmelkowy-koliberek-desktop-9.10-i386-PL.iso / casper / filesystem.squashfs / usr / share / m17n / GUJR-OTF.flt < prev    next >
Text File  |  2009-04-29  |  4KB  |  172 lines

  1. ;; GUJR-OTF.flt -- Font Layout Table for Gujarati OpenType fonts
  2. ;; Copyright (C) 2004, 2007  AIST (H15PRO112)
  3. ;; See the end for copying conditions.
  4.  
  5. (font layouter gujr-otf nil
  6.       (font (nil nil unicode-bmp :otf=gujr=rphf)))
  7.  
  8. ;;; <li> GUJR-OTF.flt
  9. ;;;
  10. ;;; For Gujarati OpenType fonts to draw the Gujarati script.
  11.  
  12. (category
  13.  ;; C: consonant (except for RA)
  14.  ;; R: consonant RA
  15.  ;; n: NUKTA
  16.  ;; H: HALANT
  17.  ;; m: vowel sign (pre)
  18.  ;; u: vowel sign (above)
  19.  ;; b: vowel sign (below)
  20.  ;; p: vowel sign (post)
  21.  ;; A: vowel modifier (above)
  22.  ;; a: vowel modifier (post)
  23.  ;; V: independent vowel
  24.  ;; N: ZWNJ
  25.  ;; J: ZWJ
  26.  ;; X: generic
  27.  (0x0A80 0x0AFF    ?X)            ; generic
  28.  (0x0A81 0x0A82    ?A)            ; SIGN CANDRABINDU .. ANUSVARA
  29.  (0x0A83    ?a)            ; SIGN VISARGA
  30.  (0x0A85 0x0A94    ?V)            ; LETTER AA .. AU
  31.  (0x0A95 0x0AB9 ?C)            ; LETTER KA .. HA
  32.  (0x0AB0    ?R)            ; LETTER RA
  33.  (0x0ABC    ?n)            ; SIGN NUKTA
  34.  (0x0ABE     ?p)            ; VOWEL SIGN AA
  35.  (0x0ABF    ?m)            ; VOWEL SIGN I
  36.  (0x0AC0    ?p)            ; VOWEL SIGN II
  37.  (0x0AC1 0x0AC4    ?b)            ; VOWEL SIGN U .. VOCALIC RR
  38.  (0x0AC5 0x0AC8    ?u)            ; VOWEL SIGN CANDRA E .. AI
  39.  (0x0AC9 0x0ACC    ?p)            ; VOWEL SIGN CANDRA O .. AU
  40.  (0x0ACD    ?H)            ; SIGN VIRAMA
  41.  (0x0AE0 0x0AE1    ?V)            ; LETTER VOCALIC RR .. VOCALIC LL
  42.  (0x0AE2 0x0AE3    ?b)            ; VOWEL SIGN VOCALIC L .. VOCALIC LL
  43.  (0x0964 0x0965    ?X)            ; DANDA .. DOUBLE DANDA
  44.  (0x200C    ?N)            ; ZWNJ
  45.  (0x200D    ?J)            ; ZWJ
  46.  )
  47.  
  48. ;; Syllable identification and reordering.
  49. (generator
  50.  (0
  51.   (cond
  52.    ;; A syllable containing a vowel sign.
  53.    ;;1      2            34   5       6
  54.    ("([CR]n?(HJ?[CR]n?)*)((m)|(b|u|p))(A|a)?"
  55.     < | (4 =) (1 move-h) (5 =) (1 reph) (6 =) | >)
  56.  
  57.    ;; A syllable without vowel signs but with a vowel modifier.
  58.    ;;1      2            3
  59.    ("([CR]n?(HJ?[CR]n?)*)(A|a)"
  60.     < | (1 move-h) (1 reph) (3 =) | >)
  61.  
  62.    ;; No marks at all.  Need further anylysis.
  63.    ("[CR]n?(HJ?[CR]n?)*(H(N|J)?)?"
  64.     < | (0 nomarks) | >)
  65.  
  66.    ;; A syllable starting with an independent vowel.
  67.    ("V(A|a)?"
  68.     < | = * | >)
  69.  
  70.    ("." =))
  71.   *)
  72.  
  73.  (move-h
  74.   (cond
  75.    ("RH(.+)(H)(R)$"
  76.     (1 = *) (3 =) (2 =))
  77.    ("RH(.+)"
  78.     (1 = *))
  79.  
  80.    ("(.+)(H)(R)$"
  81.     (1 = *) (3 =) (2 =))
  82.    (".+"
  83.     = *)))
  84.  
  85.  (reph
  86.   (cond
  87.    ("(RH).*"
  88.     (1 otf:gujr=rphf+))))
  89.  
  90.  (del-reph
  91.   (cond
  92.    ("(RH)?(.*)"
  93.     (2 = *))))
  94.  
  95.  (nomarks
  96.   (cond
  97.    ;; Ending with a Halant and a ZWJ.
  98.    (".+HJ$"
  99.     (0 del-reph) (0 reph))
  100.  
  101.    ;; Ending with a Halant and an optional ZWNJ.  Add ZWNJ explicitly.
  102.    ("(.+)(H)N?$"
  103.     (1 move-h) (1 reph) (2 =) 0x200C)
  104.  
  105.    ;; Ending with a consonant.
  106.    (".+"
  107.     (0 move-h) (0 reph))))
  108.  )
  109.  
  110. ;; Apply GSUB features.  If a syllable ends with a halant and a ZWNJ,
  111. ;; render the final halant explicitly.  Do not apply 'blwf' to the
  112. ;; initial RA.
  113. (generator
  114.  (0
  115.   (cond
  116.    (" (R)([^ ]*)(H)N "
  117.     | (1 =) (2 gsub) (3 =) |)
  118.    (" (m?R)([^ ]*) "
  119.     | (1 otf:gujr=pres+) (2 gsub) |)
  120.  
  121.    (" ([^ ]+)(H)N "
  122.     | (1 gsub) (2 =) |)
  123.    (" ([^ ]+) "
  124.     | (1  gsub) |)
  125.  
  126.    ("." =))
  127.   *)
  128.  
  129.  (gsub
  130.   (cond
  131.    ("([^J]*)J(.*)"
  132.     (1 otf:gujr=nukt,akhn,blwf,half,vatu,pres+) (2 gsub))
  133.    (".*"
  134.     otf:gujr=nukt,akhn,blwf,half,vatu,pres+)))
  135.  )
  136.  
  137. ;; Apply other features.
  138. (generator
  139.  (0
  140.   (cond
  141.    (" ([^ ]+) "
  142.     (1 otf:gujr=abvs,blws,psts,haln+abvm,blwm,dist))
  143.    ("."
  144.     [ = ]))
  145.   *))
  146.  
  147. ;; Copyright (C) 2004, 2007
  148. ;;   National Institute of Advanced Industrial Science and Technology (AIST)
  149. ;;   Registration Number H15PRO112
  150.  
  151. ;; This file is part of the m17n database; a sub-part of the m17n
  152. ;; library.
  153.  
  154. ;; The m17n library is free software; you can redistribute it and/or
  155. ;; modify it under the terms of the GNU Lesser General Public License
  156. ;; as published by the Free Software Foundation; either version 2.1 of
  157. ;; the License, or (at your option) any later version.
  158.  
  159. ;; The m17n library is distributed in the hope that it will be useful,
  160. ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
  161. ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  162. ;; Lesser General Public License for more details.
  163.  
  164. ;; You should have received a copy of the GNU Lesser General Public
  165. ;; License along with the m17n library; if not, write to the Free
  166. ;; Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
  167. ;; Boston, MA 02110-1301, USA.
  168.  
  169. ;; Local Variables:
  170. ;; mode: emacs-lisp
  171. ;; End:
  172.